<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="/lib/umd/single-spa.js"></script>
    <script>
        // 默认先加载应用 在调用start方法时进行挂载应用
        // 1. 注册应用名 2. 返回一个promise的函数 函数返回值为一个对象，包含三个函数 bootstrap mount unmount
        singleSpa.registerApplication('app1',async () => {
            return {
                bootstrap: async () => {

                },
                mount: async () => {

                },
                unmount: async () => {

                }
            }
            },
            location => location.hash.startsWith('#/app1'),
            {
                store: {
                    name: '11',
                    age: 1
                }
            }
        )
        // 挂载应用
        singleSpa.start();
    </script>
</body>
</html>